/**
 * 
 */
package org.dragonfire.dasm.directives;

import java.util.ArrayList;

import org.dragonfire.dasm.Command;
import org.dragonfire.dasm.Listing;
import org.dragonfire.dasm.DirectiveManager.Directive;

/**
 * Enters a module, increasing the module depth by one.<br />
 * <br />
 * Format:<br />
 * <code>#MODULE <i>&lt;name&gt;</i></code><br />
 * <br />
 * Parameters:<br />
 * <table>
 * <tr>
 * <td><code>name</code></td>
 * <td>(String) The name of the module</td>
 * </tr>
 * </table><br />
 * Errors:<br />
 * <table>
 * <tr>
 * <td><code>ERROR_NOT_ENOUGH_ARGS</code></td>
 * <td>Thrown if <code>name</code> is not defined</td>
 * </tr>
 * <tr>
 * <td><code>ERROR_STRING_REQUIRED</code></td>
 * <td>Thrown if <code>name</code> is not a string</td>
 * </tr>
 * <tr>
 * <td><code>ERROR_BAD_MODULE</code></td>
 * <td>Thrown if <code>name</code> is not a valid module name.</td>
 * </tr>
 * </table>
 * 
 * @author Darth Android
 * @see Endmodule
 * @see org.dragonfire.dasm.preprocessor.Preprocessor#enterModule(String)
 */
public class Module extends Directive {

	/**
	 * {@inheritDoc}
	 */
	@Override
	public ArrayList<Listing> pass1(Command c) {
		getPreprocessor().enterModule(evalString(c.getParam(0)));
		return null;
	}
}
